home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / CoreFoundation / CFBag.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  3.8 KB  |  163 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        CFBag.h
  3.  
  4.      Contains:    CoreFoundation bag collection
  5.  
  6.      Version:    Technology:    Mac OS X
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COREFOUNDATION_CFBAG__
  18. #define __COREFOUNDATION_CFBAG__
  19.  
  20. #ifndef __COREFOUNDATION_CFBASE__
  21.     #include <CoreFoundation\CFBase.h>
  22. #endif
  23.  
  24.  
  25.  
  26.  
  27.  
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #if PRAGMA_IMPORT
  37. #pragma import on
  38. #endif
  39.  
  40. #if PRAGMA_STRUCT_ALIGN
  41.     #pragma options align=mac68k
  42. #elif PRAGMA_STRUCT_PACKPUSH
  43.     #pragma pack(push, 2)
  44. #elif PRAGMA_STRUCT_PACK
  45.     #pragma pack(2)
  46. #endif
  47.  
  48. typedef CALLBACK_API_C( const void *, CFBagRetainCallBack )(CFAllocatorRef allocator, const void *ptr);
  49. typedef CALLBACK_API_C( void , CFBagReleaseCallBack )(CFAllocatorRef allocator, const void *ptr);
  50. typedef CALLBACK_API_C( CFStringRef , CFBagCopyDescriptionCallBack )(const void *ptr);
  51. typedef CALLBACK_API_C( Boolean , CFBagEqualCallBack )(const void *ptr1, const void *ptr2);
  52. typedef CALLBACK_API_C( CFHashCode , CFBagHashCallBack )(const void *ptr);
  53.  
  54. struct CFBagCallBacks {
  55.     CFIndex                         version;
  56.     CFBagRetainCallBack             retain;
  57.     CFBagReleaseCallBack             release;
  58.     CFBagCopyDescriptionCallBack     copyDescription;
  59.     CFBagEqualCallBack                 equal;
  60.     CFBagHashCallBack                 hash;
  61. };
  62. typedef struct CFBagCallBacks            CFBagCallBacks;
  63. extern const CFBagCallBacks kCFTypeBagCallBacks;
  64. extern const CFBagCallBacks kCFCopyStringBagCallBacks;
  65. typedef CALLBACK_API_C( void , CFBagApplierFunction )(const void *val, void *context);
  66. typedef const struct __CFBag * CFBagRef;
  67. typedef struct __CFBag * CFMutableBagRef;
  68. EXTERN_API_C( CFTypeID )
  69. CFBagGetTypeID                    (void);
  70.  
  71.  
  72. EXTERN_API_C( CFBagRef )
  73. CFBagCreate                        (CFAllocatorRef         allocator,
  74.                                  const void **            values,
  75.                                  CFIndex                 numValues,
  76.                                  const CFBagCallBacks *    callBacks);
  77.  
  78. EXTERN_API_C( CFBagRef )
  79. CFBagCreateCopy                    (CFAllocatorRef         allocator,
  80.                                  CFBagRef                 bag);
  81.  
  82. EXTERN_API_C( CFMutableBagRef )
  83. CFBagCreateMutable                (CFAllocatorRef         allocator,
  84.                                  CFIndex                 capacity,
  85.                                  const CFBagCallBacks *    callBacks);
  86.  
  87. EXTERN_API_C( CFMutableBagRef )
  88. CFBagCreateMutableCopy            (CFAllocatorRef         allocator,
  89.                                  CFIndex                 capacity,
  90.                                  CFBagRef                 bag);
  91.  
  92.  
  93. EXTERN_API_C( CFIndex )
  94. CFBagGetCount                    (CFBagRef                 bag);
  95.  
  96. EXTERN_API_C( CFIndex )
  97. CFBagGetCountOfValue            (CFBagRef                 bag,
  98.                                  const void *            value);
  99.  
  100. EXTERN_API_C( Boolean )
  101. CFBagContainsValue                (CFBagRef                 bag,
  102.                                  const void *            value);
  103.  
  104. EXTERN_API_C( const void *)
  105. CFBagGetValue                    (CFBagRef                 bag,
  106.                                  const void *            candidate);
  107.  
  108. EXTERN_API_C( Boolean )
  109. CFBagGetValueIfPresent            (CFBagRef                 bag,
  110.                                  const void *            candidate,
  111.                                  const void **            value);
  112.  
  113. EXTERN_API_C( void )
  114. CFBagGetValues                    (CFBagRef                 bag,
  115.                                  const void **            values);
  116.  
  117. EXTERN_API_C( void )
  118. CFBagApplyFunction                (CFBagRef                 bag,
  119.                                  CFBagApplierFunction     applier,
  120.                                  void *                    context);
  121.  
  122.  
  123. EXTERN_API_C( void )
  124. CFBagAddValue                    (CFMutableBagRef         bag,
  125.                                  const void *            value);
  126.  
  127. EXTERN_API_C( void )
  128. CFBagReplaceValue                (CFMutableBagRef         bag,
  129.                                  const void *            value);
  130.  
  131. EXTERN_API_C( void )
  132. CFBagSetValue                    (CFMutableBagRef         bag,
  133.                                  const void *            value);
  134.  
  135. EXTERN_API_C( void )
  136. CFBagRemoveValue                (CFMutableBagRef         bag,
  137.                                  const void *            value);
  138.  
  139. EXTERN_API_C( void )
  140. CFBagRemoveAllValues            (CFMutableBagRef         bag);
  141.  
  142.  
  143. #if PRAGMA_STRUCT_ALIGN
  144.     #pragma options align=reset
  145. #elif PRAGMA_STRUCT_PACKPUSH
  146.     #pragma pack(pop)
  147. #elif PRAGMA_STRUCT_PACK
  148.     #pragma pack()
  149. #endif
  150.  
  151. #ifdef PRAGMA_IMPORT_OFF
  152. #pragma import off
  153. #elif PRAGMA_IMPORT
  154. #pragma import reset
  155. #endif
  156.  
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160.  
  161. #endif /* __COREFOUNDATION_CFBAG__ */
  162.  
  163.